package com.waitingresult.collection.list;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: WangShuai
 * @CreateTime: 2022-11-18  10:48
 * @Description: 引用问题
 * @Version: 1.0
 */
public class ArrayListReferenceDemo {
    @Data
    static class Entity{
        private List<Integer> list ;
    }
    public static void main(String[] args) {
        Entity entity = new Entity();
        ArrayList<Integer> list = new ArrayList<>();
        entity.setList(list);
        System.err.println(entity);
        for (int i = 0; i < 10; i++) {
            list.add(i);
        }
        System.err.println(entity);


    }
}
